﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CStock
{
    public class IndicatorUtil
    {
        public static bool GetIndicatorChartStatus(int chartnumber, IIndicator ind, IProfile myprofile)
        {
            //if (ind.ShowOnChart)
            if (myprofile.ChartLine != null)
            {
                for (int i = 0; i < myprofile.ChartLine.Count; i++)
                {
                    ChartLine cl = myprofile.ChartLine[i];
                    if (!cl.IsEquity)
                    {
                        if (cl.IndicatorOrShareName == ind.Name)
                        {
                            if (cl.ChartNumber == chartnumber)
                                return true;
                            
                        }
                    }
                }
                return false;
            }
            return false;

        }
        public static IList<string> GetAdditionalDataItemsOnCharts(int chartnumber, IProfile myprofile)
        {
            //if (ind.ShowOnChart)
            IList<string> listSharesOnChart = new List<string>();
            if (myprofile.ChartLine != null)
            {
                for (int i = 0; i < myprofile.ChartLine.Count; i++)
                {
                    ChartLine cl = myprofile.ChartLine[i];
                    if (cl.IsEquity)
                    {

                        if (cl.ChartNumber == chartnumber)
                        {
                            listSharesOnChart.Add(cl.IndicatorOrShareName);
                        }

                    }
                }
            }
            return listSharesOnChart;

        }
      
       
    }
}
